package test03;

import java.sql.Connection;

/**
 * @Author lzp
 * @Date 2024-04-07
 */
public class Test01 {
    public static void main(String[] args) {
        add();
        del();
    }

    private static void add() {
        String sql = "insert into staffs(name,age,phone,sta_pos) values (?,?,?,?)";
        Connection connection =DbUtil.getConnection();
        SqlRunner sqlRunner = new SqlRunner(connection);
        int r = sqlRunner.update(sql,"xxx", 20, "15500000000", "项目经理");
        System.out.println(r);
    }
    private static void del() {
        String sql = "delete from staffs where id=?";
        Connection connection = DbUtil.getConnection();
        SqlRunner sqlRunner = new SqlRunner(connection);
        int r = sqlRunner.update(sql,1);
        System.out.println(r);
    }




}
